package com.sentrix.auto.printercenter.presentation.center;

import com.sentrix.auto.printercenter.application.AgentService;
import com.sentrix.auto.printercenter.presentation.center.dto.AgentResDto;
import com.sentrix.auto.printercenter.presentation.common.DataResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("agent")
@Tag(name = "打印Agent管理", description = "打印Agent查询")
public class PrinterAgentController {

    @Resource
    private AgentService agentService;


    @Operation(summary = "列表查询：打印Agent列表")
    @GetMapping("list")
    public DataResponse<AgentResDto> list(){
         List<AgentResDto> agents = agentService.queryAll(AgentResDto::fromDomain);
         return new DataResponse("1", true, 200, "查询成功", agents);
    }
}
